1. Field of the Invention
The invention relates to an apparatus and method for selecting one out of two functions, and particularly to an apparatus and method for selecting between either a host function or a device function.
2. Description of the Related Art
With the advances of digital technology, digital system such as personal computers (PCs), digital cameras, printers, and cell phones have been in wide use. The PC may be connected to a printer for printing image data that are stored in the PC. A digital camera may also be connected to the printer so that data in the camera can be printed as images. Further, the digital camera may be connected to the PC so that data in the camera can be transferred to the PC in order for the data already stored in the camera to be edited. In this way, the systems are interconnected for data transfer. Interconnections between various types of systems are presumed to increase from now on.
FIG. 1 illustrates a host 1 and a device 2 that are connected to each other through an interface. The connection may be made to carry out high-speed data transfer. For this case, for example, the host 1 is a PC, and the device 2 may be, for example, one of a digital camera, cell phone, printer, or audio player. The interface may be a USB (Universal Serial Bus). The host 1 has only a host function, sends instructions, and sends and receives data. The device 2, on the other hand, has only a device function, works on instructions from the host 1, and sends and receives data. The interface can equivalently be expressed as a line 1, a line 2, and the ground.
The host 1, seen from a dotted line shown as a centerline, can be expressed as, including the interface, an equivalent circuit 1xe2x80x2. The equivalent circuit comprises a combination of a power supply Vs, a transceiver 3, and two resistors. The power supply Vs may be, for example, 5.0 volts (V). The transceiver 3 is connected between the line 1 and the line 2, and controls sending and receiving signals. One of the resistors is connected between the line 1 and the ground and the other is connected between the line 2 and the ground. Both of the resistors may be, for example, 15 kiloohms (kxcexa9).
The device 2, seen from the dotted line, can be expressed as, including the interface, an equivalent circuit 2xe2x80x2. The equivalent circuit 2 comprises a transceiver 4 and a resistor. The transceiver 4 is connected between the line 1 and the line 2. The resistor of 1.5 kxcexa9 is pulled up to a power supply of 3.3 V from the line 2. On the line 2, the voltage of 3.0 V is detected by dividing 3.3 V by 15 kxcexa9/( 1.5 kxcexa9+15 kxcexa9).
FIG. 2 illustrates a host 5 and a device 6 that are connected to each other through an interface. The connection may be made to conduct low-speed data transfer. The host 5 and interface are the same as those explained in FIG. 1. The device 6 may be, for example, a mouse, or keyboard. An equivalent circuit 5xe2x80x2 for the host 5 comprises a transceiver 7 and two resistors of 15 kxcexa9. The connection of the components is the same as that in FIG. 1. The device 6 is expressed as an equivalent circuit 6xe2x80x2 of a transceiver 8 and a resistor. The resistor of 1.5 kxcexa9 is pulled up to a voltage supply of 3.3 V from the line 1. On the line 1, the voltage of 3.0 V is obtained by dividing 3.3 V by 15 kxcexa9/(1.5 kxcexa9+15 kxcexa9).
However, under the systems shown in the figures, the host has a host function only and the device, regardless of high or low data transfer, has a device function only. This causes users inconvenience since the host cannot be used as a device and the device cannot be used as a host. Those apparatuses lack versatility. Thus, there is a need to realize versatility of one apparatus and make full use of its functions.
One aspect of the invention is directed to an apparatus for selecting one out of two functions. The apparatus comprises a first entity having a first function, a second function, at least one detector and a function select mechanism; a second entity having at least one function of the first and the second function; and an interface for connecting the first entity and second entity, the interface connected to the at least one detector; whereby the at least one detector detects a function of the second entity when connected to the first entity, and the function select mechanism selects one out of the first and second functions in the first entity in response to an output of the at least one detector corresponding to the detected function.
Another aspect of the invention is directed to an apparatus for selecting one out of two functions. The apparatus comprises a first entity having a first function, a second function, at least one detector and a function select mechanism; a second entity having one function of the first and the second function; and an interface for connecting the first entity and second entity, the interface connected to the at least one detector; whereby the at least one detector detects a function of the second entity when connected to the first entity, and the function select mechanism selects one out of the first and second functions in the first entity in response to an output of the at least one detector corresponding to the detected function.
Still another aspect of the invention is directed to an apparatus for selecting one out of two functions. The apparatus comprises a first entity having a first function, a second function, a detector and a function select mechanism; a second entity having one function of the first and the second function; and an interface for connecting the first entity and second entity, the interface connected to the detector; whereby the detector detects a function of the second entity when connected to the first entity, and the function select mechanism selects one out of the first and second functions in the first entity in response to an output of the detector corresponding to the detected function.
Further still another aspect of the invention is directed to a method of selecting one out of a first function and a second function a first entity has, with respect to a second entity that has at least one of the first and second functions. The method comprises activating a first power source to the first entity; connecting the first entity to the second entity via an interface; detecting at least one voltage on the interface by connecting a first resistor between the interface and a second power source; determining first if the detected voltage is over a threshold; if so, connecting a second resistor between the interface and the ground; detecting a divided voltage derived from the second power source and a ratio of the second resistance to the second resistance plus the first resistance; determining second if the detected divided voltage is over the threshold; if so, selecting the first function; if the detected voltage is not over the threshold at the first determination, deactivating the first power source; connecting a third resistor between the interface and the second power source; waiting for a specified packet to be sent; if the packet is received, selecting the second function.
Another aspect of the invention is directed to a method of selecting one out of a first function and a second function a first entity has, with respect to a second entity that has one of the first and second functions. The method comprises providing a power source to the first entity; connecting the first entity to the second entity via an interface; detecting at least one voltage on the interface; determining if the detected voltage is over a threshold; if so, selecting the first function; and if not, selecting the second function.